#include<iostream>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
using namespace std;
typedef long long LL;
priority_queue<int>q;
const int N = 110;
int st[N];
int n, k, m;
int arr[N];
int main()
{
	cin >> n >> m >> k;
	for (int i = 0; i < n; i++) {
		arr[i] = i;
		st[i] = 1;
	}
	/*for (int i = 0; i < n; i++) {
		cout << arr[i] << " ";
	}
	cout << endl;*/
	int pos = arr[m];
	int number = n;
	int a = 1;
	while (number != 1) {
		if (a == k) {
			if (st[pos] == 1) {
				a = 1;
				st[pos] = 0;
				cout << pos << " ";
				number--;
				pos = (++pos) % n;
			}
			else {
				pos = (++pos) % n;
			}
		}
		else {
			if (st[pos] == 1) {
				a++;
			}
			pos = (++pos) % n;
		}
	}
	//cout << endl;
	for (int i = 0; i < n; i++) {
		if (st[i] == 1) {
			cout << i << endl;
			break;
		}
	}
	return 0;
}